package com.shuoyue.ycgk.utils;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.shuoyue.ycgk.R;
import com.yanzhenjie.album.AlbumFile;
import com.yanzhenjie.album.AlbumLoader;

/**
 * 用Glide实现AlbumLoader
 * Author: Forty'7 on 2019/3/30 15:05
 * Email：xiaowangboke@vip.qq.com
 */
public class GlideAlbumLoader implements AlbumLoader {

    @Override
    public void load(ImageView imageView, AlbumFile albumFile) {
        load(imageView, albumFile.getPath());
    }

    @Override
    public void load(ImageView imageView, String url) {
        Glide.with(imageView.getContext())
                .load(url)
                .error(R.mipmap.img_loading_gray)
                .placeholder(R.mipmap.img_loading_gray)
                .into(imageView);
    }


}